package com.wb.mas.ui.guide;

import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import androidx.lifecycle.ViewModelProviders;

import com.wb.mas.BR;
import com.wb.mas.R;
import com.wb.mas.app.AppViewModelFactory;
import com.wb.mas.databinding.ActGuideBinding;

import me.goldze.mvvmhabit.base.BaseActivity;

/**
 * Copyright (C) 2018,
 * a
 * <p>
 * Description
 * 引导页Activity
 *
 * @author mwl
 * @version 1.0
 * <p>
 * Ver 1.0, 2019-04-28, yue, Create file
 */
public class GuideActivity extends BaseActivity<ActGuideBinding, GuideViewModel> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.act_guide;
    }

    @Override
    public GuideViewModel initViewModel() {
        //使用自定义的ViewModelFactory来创建ViewModel，如果不重写该方法，则默认会调用LoginViewModel(@NonNull Application application)构造方法
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(GuideViewModel.class);
    }



    @Override
    public int initVariableId() {
        return BR.viewModel;
    }


}
